Skip to content

refactor: rename reference checker names#244

Merged
ktro2828 merged 1 commit into
mainfrom
refactor/sanity/rule-id
Dec 3, 2025
Merged

refactor: rename reference checker names#244
ktro2828 merged 1 commit into
mainfrom
refactor/sanity/rule-id

Conversation

@ktro2828

@ktro2828 ktro2828 commented Dec 3, 2025

Copy link
Copy Markdown
Collaborator

What

This pull request reorganizes and refactors the reference checkers in the codebase to improve clarity and maintainability. The main changes include splitting the requirements in the documentation into clearer thematic groups, renaming and reassigning reference checker classes and files to match the new grouping, and updating imports and tests to use the new identifiers.

Documentation and requirement grouping:

  • The docs/schema/requirement.md file now separates reference requirements into three groups: "Record Reference (A to B)", "Record Reference (A to A')", and "File Reference", with updated IDs and descriptions for each requirement. [1] [2]

Codebase refactor and renaming:

  • Reference checker classes and files have been renamed to match the new requirement IDs (e.g., REF016REF101, REF013REF201) and split into thematic groups. The corresponding __init__.py imports have been updated. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Test updates:

  • All references to the old checker classes in tests/sanity/test_reference_checkers.py have been updated to use the new identifiers and imports, including parameterized tests and individual test cases. [1] [2] [3] [4] [5]

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings December 3, 2025 04:15
@github-actions github-actions Bot added ci Continuous Integration (CI) processes and testing documentation Improvements or additions to documentation refactor Refactoring code or increasing performance labels Dec 3, 2025
@github-actions

github-actions Bot commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
4086 3379 83% 50% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
t4_devkit/sanity/reference/init.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 0f3d61a by action🐍

@ktro2828 ktro2828 merged commit 5ab8fd9 into main Dec 3, 2025
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the reference checker naming scheme to improve organization and clarity. The checkers are reorganized into three thematic groups: record-to-record references (A to B), same-record references (A to A'), and file references, with IDs renumbered accordingly (REF013-021 → REF101-106, REF201-203).

Key changes:

  • Reorganized documentation into three clear reference checker categories
  • Renamed checker classes and files from REF013-021 to REF101-106 and REF201-203
  • Updated all imports and test references to use new identifiers

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/schema/requirement.md Restructured reference requirements into three themed sections with updated IDs
t4_devkit/sanity/reference/init.py Updated imports to reflect renamed checker modules
t4_devkit/sanity/reference/ref101.py Renamed REF016 → REF101 (Sample.next checker)
t4_devkit/sanity/reference/ref102.py Renamed REF017 → REF102 (Sample.prev checker)
t4_devkit/sanity/reference/ref103.py Renamed REF018 → REF103 (SampleAnnotation.next checker)
t4_devkit/sanity/reference/ref104.py Renamed REF019 → REF104 (SampleAnnotation.prev checker)
t4_devkit/sanity/reference/ref105.py Renamed REF020 → REF105 (SampleData.next checker)
t4_devkit/sanity/reference/ref106.py Renamed REF021 → REF106 (SampleData.prev checker)
t4_devkit/sanity/reference/ref201.py Renamed REF013 → REF201 (SampleData.filename checker)
t4_devkit/sanity/reference/ref202.py Renamed REF014 → REF202 (SampleData.info_filename checker)
t4_devkit/sanity/reference/ref203.py Renamed REF015 → REF203 (LidarSeg.filename checker)
tests/sanity/test_reference_checkers.py Updated test imports and test function names to match new checker IDs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


id = RuleID("REF014")
id = RuleID("REF202")
name = RuleName("sample-data-filename-presence")

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name field 'sample-data-filename-presence' is inconsistent with the description and actual functionality. This checker validates 'info_filename', not 'filename'. The name should be 'sample-data-info-filename-presence' to match the documentation and checker ID REF202.

Suggested change
name = RuleName("sample-data-filename-presence")
name = RuleName("sample-data-info-filename-presence")

Copilot uses AI. Check for mistakes.
"""Mutate sample_data.json to point to a missing file for REF013."""
def test_ref201_fail_missing_filename(tmp_path: Path) -> None:
"""Mutate sample_data.json to point to a missing file for REF201."""
root = _copy_dataset(tmp_path / "dataset_ref013_fail")

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directory name 'dataset_ref013_fail' should be updated to 'dataset_ref201_fail' to match the renamed checker REF201.

Suggested change
root = _copy_dataset(tmp_path / "dataset_ref013_fail")
root = _copy_dataset(tmp_path / "dataset_ref201_fail")

Copilot uses AI. Check for mistakes.
"""Add an info_filename pointing to a non-existing file to trigger REF014 failure."""
def test_ref202_fail_missing_info_filename(tmp_path: Path) -> None:
"""Add an info_filename pointing to a non-existing file to trigger REF202 failure."""
root = _copy_dataset(tmp_path / "dataset_ref014_fail")

Copilot AI Dec 3, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The directory name 'dataset_ref014_fail' should be updated to 'dataset_ref202_fail' to match the renamed checker REF202.

Suggested change
root = _copy_dataset(tmp_path / "dataset_ref014_fail")
root = _copy_dataset(tmp_path / "dataset_ref202_fail")

Copilot uses AI. Check for mistakes.
@ktro2828 ktro2828 deleted the refactor/sanity/rule-id branch December 3, 2025 04:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci Continuous Integration (CI) processes and testing documentation Improvements or additions to documentation refactor Refactoring code or increasing performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants